<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>空口信令查询</title>
<%
	// 权限验证
	if(session.getAttribute("currentMemberShip")==null){
		response.sendRedirect("login.jsp");
		return;
	}
%>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	var page=0;
	var lasttime;
	
	function getCommonData() {
		var district = $("#district").combotree("getText");
		console.log(district);
		var startTime=$("#i1").datebox("getValue");
		var endTime=$("#i2").datebox("getValue");
		var IMSI = '';
		var MSISDN = '';
		var CTCS_ID = '';
		if ($('#in1').searchbox('getName') == 'IMSI') {
			IMSI = $('#in1').searchbox('getValue');
		} else if ($('#in1').searchbox('getName') == 'MSISDN') {
			MSISDN = $('#in1').searchbox('getValue');
		} else if ($('#in1').searchbox('getName') == 'CTCS_ID') {
			CTCS_ID = $('#in1').searchbox('getValue');
		}
		var UmType = $("#UmType").combotree("getText");

		var kilometerStart = $("#kilometerStart").val();
		var kilometerStart2 = $("#kilometerStart2").val();
		
		if (kilometerStart2.length == 2) {
			kilometerStart2 = '0' + kilometerStart2;
		} else if (kilometerStart2.length == 1) {
			kilometerStart2 = '00' + kilometerStart2;
		} else if (kilometerStart2.length == 0 && kilometerStart.length > 0) {
			kilometerStart2 = '000' + kilometerStart2;
		}
		var kilometerStartLong = kilometerStart + kilometerStart2;

		var kilometerEnd = $("#kilometerEnd").val();
		var kilometerEnd2 = $("#kilometerEnd2").val();
		if (kilometerEnd2.length == 2) {
			kilometerEnd2 = '0' + kilometerEnd2;
		} else if (kilometerEnd2.length == 1) {
			kilometerEnd2 = '00' + kilometerEnd2;
		} else if (kilometerEnd2.length == 0 && kilometerEnd.lenght > 0) {
			kilometerEnd2 = '000' + kilometerEnd2;
		}
		var kilometerEndLong = kilometerEnd +kilometerEnd2;
		
		startDate = new Date(startTime.replace(new RegExp("-","gm"),"/"));
		endDate = new Date(endTime.replace(new RegExp("-","gm"),"/"));
		var startTimeLong = startDate.getTime();
		var endTimeLong = endDate.getTime();
		
		var recordId = $("#recordId").val()
		
		return {"startTime":startTimeLong, "endTime":endTimeLong, "IMSI":IMSI, "MSISDN":MSISDN, "CTCS_ID":CTCS_ID, "UmType":UmType,
			"district":district, "kilometerStart":kilometerStartLong, "kilometerEnd":kilometerEndLong, "recordId": recordId};
	}
	
	function searchSDCCH(){
		page=1;
	
		var data = getCommonData();
		
		if(data.startTime - data.endTime > 0){
			$.messager.alert("系统提示","查询开始时间不能大于结束时间！");
			return;
		}
		if(data.kilometerStart - data.kilometerEnd > 0){
			$.messager.alert("系统提示","公里标下限值不能大于公里标上限值！");
			return;
		}
		
		sendData(data, page, '1');

		$("#myDiv").html('');
	}
	
	function searchNext(){
		var size=$("#dg" ).datagrid("getPager" ).data("pagination" ).options.pageSize;
		var rows  = $('#dg').datagrid("getRows");  
		if(rows.length<size){
			$.messager.alert("系统提示","当前页已经是最后一页！");
			return;
		}
		else{
			lasttime=rows[rows.length-1].startTime;
		}

		var data = getCommonData();
		
		data.startTime = lasttime;
		page=page+1;
		
		sendData(data, page, '1');
		
	}
	
	function searchBack(){
		if(page==1){
			$.messager.alert("系统提示","当前页已经是第一页！");
			 return;
		}

		var data = getCommonData();
		
		var rowsbefore = $('#dg').datagrid("getRows"); 
		if(rowsbefore.length>0){
			data.endTime = rowsbefore[0].startTime;
		} else {
			data.endTime = lasttime+1;
		}
		page=page-1;
		
		sendData(data, page, '0');
	}
	
	function sendData(data, page, increase) {
		var currentpage="第 "+page+" 页";
		var p=$("#dg" ).datagrid("getPager" )
		$(p).pagination({ //设置分页页数
			displayMsg:currentpage
	    });
		$("#dg").datagrid('load',{
			"startTime":data.startTime,
			"endTime":data.endTime,
			"IMSI":data.IMSI,
			"MSISDN":data.MSISDN,
			"CTCS_ID":data.CTCS_ID,
			"UmType":data.UmType,
			"district":data.district,
			"kilometerStart":data.kilometerStart,
			"kilometerEnd":data.kilometerEnd,
			"search":'1',
			"recordId": data.recordId,
			"increase":increase   //返回
		});
	}
	
	function openSDCCHAddDialog(){
		 $("#dlg").dialog("open").dialog("setTitle","添加SDCCH信息");
		 $("#flag").val(1);
		 $("#primaryKey").attr("readonly",false);
	}
	
	function openSDCCHModifyDialog(){
		 var selectedRows=$("#dg").datagrid("getSelections");
		 if(selectedRows.length!=1){
			 $.messager.alert("系统提示","请选择一条要编辑的数据！");
			 return;
		 }
		 var row=selectedRows[0];
		 $("#dlg").dialog("open").dialog("setTitle","编辑SDCCH信息");
		 $("#fm").form("load",row);
		 $("#flag").val(2);
		 $("#id").attr("readonly",true);
	}
	
	function save(){
		$("#fm").form("submit",{
			url:"${pageContext.request.contextPath}/sdcch/save.do",
			onSubmit:function(){
				return $(this).form("validate");
			},
			success:function(result){
				var result=eval('('+result+')');
				if(result.success){
					$.messager.alert("系统提示","保存成功！");
					resetValue();
					$("#dlg").dialog("close");
					$("#dg").datagrid("reload");
				}else{
					$.messager.alert("系统提示","保存失败！");
					return;
				}
			}
		 });
	}
	
	function checkData(){
		var flag=$("#flag").val();
		if(flag==1){
			$.post("${pageContext.request.contextPath}/sdcch/exisPrimaryKey.do",{primaryKey:$("#primaryKey").val()},function(result){
				if(result.exist){
					 $.messager.alert("系统提示","该PrimaryKey已存在，请更换下！");
					 $("#primaryKey").focus();
				}else{
					save();
				}
			},"json");
		}else{
			save();
		}
	}
	
	function resetValue(){
		 $("#primaryKey").val("");
		 $("#timeStamp").val("");
		 $("#startTime").val("");
		 $("#frontProcessorId").val("");
		 $("#recordId").val("");
		 $("#IMSI").val("");
		 $("#logicChannel").val("");
		 $("#MSISDN").val("");
		 $("#direction").val("");
		 $("#frameNumber").val("");
		 $("#siteName").val("");
		 $("#decode").val("");
		 $("#rawMessage").val("");
		 $("#BCCH").val("");
		 $("#layer").val("");
		 $("#length").val("");
		 $("#data").val("");
		 $("#kilometer").val("");
		 $("#speed").val("");
		 $("#CI").val("");
		 $("#LAC").val("");
		 $("#CTCS_ID").val("");
		 $("#ENGINE_ID").val("");
		 $("#MS_TYPE").val("");
		 $("#message_TYPE").val("");
		 $("#sourceData").val("");
		 $("#ARFCN").val("");
		 $("#RA").val("");
		 $("#RF_Capability").val("");
		 $("#TMSI_IMSI").val("");
		 $("#call_BCD_Num").val("");
		 $("#LU_Type").val("");
		 $("#timeSlot").val("");
		 $("#TMSI").val("");
		 $("#channel").val("");
		 $("#TCH").val("");
		 $("#IMEI").val("");
		 $("#l2").val("");
		 $("#dataLength").val("");
		 $("#LRBG").val("");
		 $("#CRC_ECC").val("");
		 $("#t_Train").val("");
	}
	
	function closeDialog(){
		 $("#dlg").dialog("close");
		 resetValue();
	}
	
	function deleteSDCCH(){
		 var selectedRows=$("#dg").datagrid("getSelections");
		 if(selectedRows.length==0){
			 $.messager.alert("系统提示","请选择要删除的数据！");
			 return;
		 }
		 var strIds=[];
		 for(var i=0;i<selectedRows.length;i++){
			 strIds.push(selectedRows[i].primaryKey);
		 }
		 var ids=strIds.join(",");
		 $.messager.confirm("系统提示","您确定要删除这<font color=red>"+selectedRows.length+"</font>条数据吗？",function(r){
			if(r){
				$.post("${pageContext.request.contextPath}/sdcch/delete.do",{primaryKeys:ids},function(result){
					if(result.success){
						 $.messager.alert("系统提示","数据已成功删除！");
						 $("#dg").datagrid("reload");
					}else{
						$.messager.alert("系统提示","数据删除失败，请联系系统管理员！");
					}
				},"json");
			} 
		 });
	}
	
	function postExcelFile(params, url) { //params是post请求需要的参数，url是请求url地址
	    var form = document.createElement("form");
	    form.style.display = 'none';
	    form.action = url;
	    form.method = "post";
	    document.body.appendChild(form);

	    for(var key in params){
	      var input = document.createElement("input");
	      input.type = "hidden";
	      input.name = key;
	      input.value = params[key];
	      form.appendChild(input);
	    }
	    form.submit();
	    form.remove();
	  }
	function exportSDCCHInCurrentPage(){
		var rows  = $('#dg').datagrid("getRows");
		if (rows.length < 1) {
			$.messager.alert("系统提示", "请查询需要导出的数据");
			return;
		}
    	var params = {data:JSON.stringify(rows)};
    	console.log(params);
    	postExcelFile(params, "${pageContext.request.contextPath}/sdcch_facch/exportcurrentpage.do");
	}
	function exportByTemplateInCurrentPage(){
		var rows = $("#dg").datagrid("getRows");
		if(rows.length<=0){
			$.messager.alert("系统提示","请先查询出要导出的数据！");
			return;
		}
		var strIds=[];
		 for(var i=0;i<rows.length;i++){
			 strIds.push(rows[i].primaryKey);
		 }
		 var ids=strIds.join(",");
		 window.open('${pageContext.request.contextPath}/sdcch_facch/exportByTemplate.do?ids='+ids+'');
	}
	function exportSDCCHInAllPages(){
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/sdcch_facch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI
				+'&MSISDN='+data.MSISDN+'&CTCS_ID='+data.CTCS_ID+'&UmType='+data.UmType+'&district='+data.district+'&kilometerStart='
				+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd+'&recordId='+data.recordId);
	}
	function exportTCHInAllPages(){
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/tch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI+'&MSISDN='+data.MSISDN+'&recordId='+data.recordId+
				'&CTCS_ID='+data.CTCS_ID+'&district='+data.district+'&kilometerStart='+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd);
	}
	function exportSACCHInAllPages(){
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/sacch/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&IMSI='+data.IMSI+'&MSISDN='+data.MSISDN+'&recordId='+data.recordId+'&CTCS_ID='+data.CTCS_ID+'&district='+data.district+'&kilometerStart='+data.kilometerStart+'&kilometerEnd='+data.kilometerEnd);
	}
	function exportByTemplateInAllPages(){
		 window.open('${pageContext.request.contextPath}/sdcch_facch/exportByTemplate.do?ids='+null+'');
	}
	
	function openUploadFileDialog(){
		$("#dlg2").dialog('open').dialog('setTitle','批量导入数据');
	}
	
	function downloadTemplate(){
		window.open('template/sdcchExportTemplate.xls');
	}
	
	function uploadFile(){
		$("#uploadForm").form("submit",{
			success:function(result){
				var result=eval('('+result+')');
				if(result.errorMsg){
					$.messager.alert("系统提示",result.errorMsg);
				}else{
					$.messager.alert("系统提示","上传成功");
					$("#dlg2").dialog("close");
					$("#dg").datagrid("reload");
				}
			}
		});
	}

	function formatDatebox(value) {
		 	var datetimeType = "";
		    var date =new Date(parseInt(value));
		    datetimeType = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()
		    +" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()+" "+date.getMilliseconds();
		    if(datetimeType != "NaN-NaN-NaN NaN:NaN:NaN NaN")
		        return datetimeType;
	}
	
	function formatRawMessage(value) {
		return JSON.stringify(value);
	}
	
	function formatDirection(value) {
		if(value==1){
			return "上行";
		}else if(value == 0){
			return "下行";
		}
	}
	
	function formatLogicChannel(value) {
		if(value==0){
			return "FrequencySpectrum";
		}else if(value==1){
			return "SDCCH";
		}else if(value==2){
			return "SACCH";
		}else if(value==3){
			return "TCH";
		}else if(value==4){
			return "SACCH_WITH_TCH";
		}else if(value==5){
                return "FACCH";
		}
        else if(value==6){
            return "RACH";
        }
        else if(value==7){
            return "BCCH";
        }
        else if(value==8) {
            return "AGCH";
        }else return value;
	}
	//重写分页
	$(function(){
		
		$('#dg').datagrid({
	    	onClickRow: function(index,row){
	    		//console.log(row.decode);
                // $("#myDiv").html(row.sourceData);
	    		$("#myDiv").html(row.decode);
	    	}
		});
		
		var p = $('#dg').datagrid('getPager');
	    $(p).pagination({ //设置分页功能栏
	           //分页功能可以通过Pagination的事件调用后台分页功能来实现
	            //layout:['prev','next'],
                layout:['list','sep'],
                /* beforePageText: '第',//页数文本框前显示的汉字 
                afterPageText: '页', */
	            displayMsg:"",   
	            buttons:[{
	    			iconCls:'icon-undo',
	    			handler:function(){
	    				searchSDCCH();
	    			}
	    		},{
	    			iconCls:'icon-back',
	    			handler:function(){
	    				searchBack();
	    			}
	    		}, {
	    			iconCls:'icon-next',
	    			handler:function(){
	    				searchNext();
	    			}
	    		}]
	    });
	    
	    
	    $('#district').combotree({
	    	url: '${pageContext.request.contextPath}/sdcch/sdcchDistrictComboList.do'
	    })

        $('#UmType').combotree('loadData', [{
            id: '1000', text: '全选', children: [
                {id: '42', text: 'Alerting'},
                {id: '43', text: 'Additional Assignment'},
                {id: '1', text: 'Assignment Complete'},
                {id: '14', text: 'Assignment Command'},
                {id: '15', text: 'Authentication Request'},
                {id: '16', text: 'Authentication Response'},
                {id: '44', text: 'Call Confirmed'},
                {id: '45', text: 'Classmark Enquiry'},
                {id: '17', text: 'Call Proceeding'},
                {id: '18', text: 'Channel Release'},
                {id: '19', text: 'Channel Request'},
                {id: '20', text: 'Classmark Change'},
                {id: '21', text: 'CM Service Accept'},
                {id: '22', text: 'CM service Request'},
                {id: '46', text: 'CM service Reject'},
                {id: '47', text: 'CM service abort'},
                {id: '43', text: 'Connect'},
                {id: '2', text: 'Connect Acknowledge'},
                {id: '48', text: 'Disconnect'},
                {id: '49', text: 'Emergency Setup'},
                {id: '23', text: 'GPRS Suspension Request'},
                {id: '3', text: 'Handover Access'},
                {id: '4', text: 'Handover Command'},
                {id: '5', text: 'Handover Complete'},
                {id: '50', text: 'Handover Failure'},
                {id: '25', text: 'Identity Request'},
                {id: '26', text: 'Identity Response'},
                {id: '6', text: 'I SIGNAL'},
                {id: '41', text: 'Immediate Assignment'},
                {id: '51', text: 'Immediate Assignment Reject'},
                {id: '52', text: 'Imsi Detach Indication'},
                {id: '27', text: 'Location Updating Accept'},
                {id: '28', text: 'Location Updating Reject'},
                {id: '29', text: 'Location Updating Request'},
                {id: '0', text: 'L2 SUB UNKNOWN'},
                {id: '30', text: 'Notification/nch'},
                {id: '7', text: 'Physical Information'},
                {id: '31', text: 'Paging Response'},
                {id: '53', text: 'Register Info'},
                {id: '54', text: 'Release'},
                {id: '55', text: 'Release Complete'},
                {id: '32', text: 'S REJ'},
                {id: '33', text: 'S RNR'},
                {id: '34', text: 'S RR'},
                {id: '35', text: 'Setup'},
                {id: '36', text: 'TMSI Reallocation Command'},
                {id: '37', text: 'TMSI Reallocation Complete'},
                {id: '9', text: 'U DM'},
                {id: '10', text: 'U SABM'},
                {id: '11', text: 'U UA'},
                {id: '12', text: 'U UI'},
                {id: '38', text: 'U DISC'},
                {id: '41', text: 'Uplink Busy'}]
        },
            {
                id: '1000', text: '特殊选择', children: [
                    {id: '60', text: 'System Information Type 1'},
                    {id: '61', text: 'System Information Type 2'},
                    {id: '62', text: 'System Information Type 3'},
                    {id: '63', text: 'System Information Type 4'},
                    {id: '64', text: 'System Information Type2_bis'}]
            },]);
	    
	    $('#i1').datetimebox('setValue', formatterDate(new Date(new Date(new Date().toLocaleDateString()).getTime())));
		$('#i2').datetimebox('setValue', formatterDate(new Date()));
		$('.searchbox-button').remove()
	});
	
	formatterDate = function (date) {
		var day = date.getDate();
		var month = (date.getMonth() + 1);
		var hor = date.getHours();
		var min = date.getMinutes();
		var sec = date.getSeconds();
		return date.getFullYear() + '-' + month + '-' + day+' '+hor+':'+min+':'+sec;
	};
	
	function formatKilometer(value) {
//		if (value.length <= 0) return; 
//		var start = value.substring(0, 4);
//		var end = value.substring(4, 7);
//		return 'k' + start + '+' + end;
		if(value.length > 3) {
			var start = value.substring(0,value.length-3);
			var end = value.substring(value.length-3, value.length);
			return 'k' + start + '+' + end;
		}
		else return value;
	}
	
	function stylerPrimaryKey (value) {
		return '<font style="color:white">'+value+'</font>';
    }
</script>
</head>
<body style="margin: 1px">
<table id="dg" title="空口信令查询" class="easyui-datagrid"
   fitColumns="fasle" pagination="true" rownumbers="true" pageSize="500" pageList="[100,200,300,400,500]"
   url="${pageContext.request.contextPath}/sdcch_facch/list.do" fit="true" toolbar="#tb"  singleSelect="true">
   <thead>
   	<tr>
 		<th field="cb" checkbox="true" align="center"></th>
 		<th field="startTime" width="140" align="center" formatter="formatDatebox">触发时间</th>
 		<th field="IMSI" width="80" align="center">IMSI</th>
 		<th field="MSISDN" width="80" align="center">MSISDN</th>
 		<th field="CTCS_ID" width="80" align="center">机车号</th>
 		<th field="siteName" width="80" align="center">小区名称</th>
 		<th field="BCCH" width="80" align="center">BCCH</th>
 		<th field="TCH" width="80" align="center">TCH</th>
 		<th field="timeSlot" width="60" align="center">时隙号</th>
 		<th field="logicChannel" width="80" align="center" formatter="formatLogicChannel">逻辑信道</th>
 		<th field="frameNumber" width="80" align="center">帧号</th>
 		<th field="direction" width="80" align="center" formatter="formatDirection">方向</th>
 		<th field="message_TYPE" width="120" align="center">Um接口消息类型</th>
        <th field="LEVEL" width="120" align="center">LEVEL</th>
        <th field="SNR" width="120" align="center">SNR</th>
        <th field="QUALITY" width="120" align="center">QUALITY</th>
 		<th field="l2" width="80" align="center">Layer2类型</th>
 		<th field="kilometer" width="80" align="center" formatter="formatKilometer">公里标</th>
 		<th field="speed" width="80" align="center">速度（km/h）</th>
 		<th field="dataLength" width="60" align="center">数据长度</th>
 		<!-- <th field="LRBG" width="80" align="center">LRBG</th>
 		<th field="CRC_ECC" width="80" align="center">CRC_ECC</th>
 		<th field="t_Train" width="80" align="center">T_Train</th> -->
 		<th field="sourceData" width="120" align="center">数据源码</th>
 		<th field="decode" width="150" align="center">解码信息</th>
 		<th field="MS_TYPE" width="80" align="center">终端类型</th>
 		<th field="TMSI" width="80" align="center">TMSI</th>
 		<th field="LAC" width="80" align="center">LAC</th>
 		<th field="CI" width="80" align="center">CI</th>
 		<th field="frontProcessorId" width="80" align="center">前置机号</th>
 		<th field="recordId" width="80" align="center">记录号</th>
 		<!-- <th field="IMEI" width="80" align="center">IMEI</th> -->
 		<!-- <th field="channel" width="80" align="center">Channel</th> -->
 		<!-- <th field="primaryKey" width="9" align="right" formatter="stylerPrimaryKey">主键</th> -->
   	</tr>
   </thead>
 </table>
 <div id="tb">
 	<div style="margin:3px">
 		<a href="javascript:exportSDCCHInCurrentPage()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前页信令数据</a>
 		<a href="javascript:exportSDCCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出所有页信令数据</a>
 		<a href="javascript:exportSACCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前条件所有测量报告及系统消息</a>
 		<a href="javascript:exportTCHInAllPages()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前条件所有TCH数据</a>
 	</div>
 	<div style="margin:3px">
 		&nbsp;&nbsp;小区：<select id="district" class="easyui-combotree" data-options="panelHeight:'auto', panelMaxHeight:'240px'" style="width:176px;" multiple></select>
 		
 		&nbsp;时间：&nbsp;<input type="text" id="i1" style="width:calc(8%)" class="easyui-datetimebox"  />
 		&nbsp;至&nbsp;
		<input type="text" id="i2" style="width:calc(8%)" class="easyui-datetimebox"   />
		
		
 		&nbsp;&nbsp;公里标： k
 		<input type="text" id="kilometerStart" style="width:35px" onkeydown="if(event.keyCode==13) searchSDCCH()"/>+<input type="text" id="kilometerStart2" style="width:35px" onkeydown="if(event.keyCode==13) searchSDCCH()"/>
 		&nbsp;至  &nbsp;k
		<input type="text" id="kilometerEnd" style="width:35px" onkeydown="if(event.keyCode==13) searchSDCCH()"/>+<input type="text" id="kilometerEnd2" style="width:35px" onkeydown="if(event.keyCode==13) searchSDCCH()"/>
 		
 		&nbsp;&nbsp;Um接口信令类型：&nbsp;
		<select id="UmType" class="easyui-combotree" data-options="panelHeight:'auto', panelMaxHeight:'240px'" style="width:235px;" multiple></select>
 		
 		&nbsp;&nbsp;记录号 ：<input type="text" style="width:115px" id="recordId" name="recordId" onkeydown="if(event.keyCode==13) searchSDCCH()"/>
 		
		&nbsp;&nbsp;<input id="in1" class="easyui-searchbox" data-options="prompt:'Please Input Value',menu:'#mm'" style="width:195px; margin-top:-20px"></input>
		<div id="mm">
			<div data-options="name:'IMSI'">IMSI</div>
			<div data-options="name:'MSISDN'">MSISDN</div>
			<div data-options="name:'CTCS_ID'">机车号</div>
		</div>
 		
 		<a href="javascript:searchSDCCH()" class="easyui-linkbutton" iconCls="icon-search" plain="true"><b style="font-size:15px">查询</b></a>
 	</div>
 	<textarea id="myDiv" style="width:99%; height:100px; margin:5px" readonly></textarea>
 </div>

 <div id="dlg" class="easyui-dialog" style="width:620px;height:250px;padding: 10px 20px" closed="true" buttons="#dlg-buttons">

   <form id="fm" method="post">
   	<table cellspacing="8px">
   		<tr>
   			<td>primaryKey：</td>
   			<td><input type="text" id="primaryKey" name="primaryKey" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>timeStamp：</td>
   			<td><input type="text" id="timeStamp" name="timeStamp" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>startTime：</td>
   			<td><input type="text" id="startTime" name="startTime" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>frontProcessorId：</td>
   			<td><input type="text" id="frontProcessorId" name="frontProcessorId" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>recordId：</td>
   			<td><input type="text" id="recordId" name="recordId" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>IMSI：</td>
   			<td><input type="text" id="IMSI" name="IMSI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>logicChannel：</td>
   			<td><input type="text" id="logicChannel" name="logicChannel" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>MSISDN：</td>
   			<td><input type="text" id="MSISDN" name="MSISDN" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>direction：</td>
   			<td><input type="text" id="direction" name="direction" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>frameNumber：</td>
   			<td><input type="text" id="frameNumber" name="frameNumber" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>siteName：</td>
   			<td><input type="text" id="siteName" name="siteName" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>decode：</td>
   			<td><input type="text" id="decode" name="decode" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>rawMessage：</td>
   			<td><input type="text" id="rawMessage" name="rawMessage" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>BCCH：</td>
   			<td><input type="text" id="BCCH" name="BCCH" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>layer：</td>
   			<td><input type="text" id="layer" name="layer" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>length：</td>
   			<td><input type="text" id="length" name="length" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>data：</td>
   			<td><input type="text" id="data" name="data" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>kilometer：</td>
   			<td><input type="text" id="kilometer" name="kilometer" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>speed：</td>
   			<td><input type="text" id="speed" name="speed" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>CI：</td>
   			<td><input type="text" id="CI" name="CI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>LAC：</td>
   			<td><input type="text" id="LAC" name="LAC" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>CTCS_ID：</td>
   			<td><input type="text" id="CTCS_ID" name="CTCS_ID" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>ENGINE_ID：</td>
   			<td><input type="text" id="ENGINE_ID" name="ENGINE_ID" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>MS_TYPE：</td>
   			<td><input type="text" id="MS_TYPE" name="MS_TYPE" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>message_TYPE：</td>
   			<td><input type="text" id="message_TYPE" name="message_TYPE" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>sourceData：</td>
   			<td><input type="text" id="sourceData" name="sourceData" class="easyui-validatebox" required="true"/></td>
   		</tr>
        <tr>
            <td>LEVEL：</td>
            <td><input type="text" id="LEVEL" name="LEVEL" class="easyui-validatebox" required="true"/></td>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
            <td>SNR：</td>
            <td><input type="text" id="SNR" name="SNR" class="easyui-validatebox" required="true"/></td>
        </tr>
        <tr>
            <td>QUALITY：</td>
            <td><input type="text" id="QUALITY" name="QUALITY" class="easyui-validatebox" required="true"/></td>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
        </tr>
   		<tr>
   			<td>ARFCN：</td>
   			<td><input type="text" id="ARFCN" name="ARFCN" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>RA：</td>
   			<td><input type="text" id="RA" name="RA" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>RF_Capability：</td>
   			<td><input type="text" id="RF_Capability" name="RF_Capability" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>TMSI_IMSI：</td>
   			<td><input type="text" id="TMSI_IMSI" name="TMSI_IMSI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>call_BCD_Num：</td>
   			<td><input type="text" id="call_BCD_Num" name="call_BCD_Num" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>LU_Type：</td>
   			<td><input type="text" id="LU_Type" name="LU_Type" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>timeSlot：</td>
   			<td><input type="text" id="timeSlot" name="timeSlot" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>TMSI：</td>
   			<td><input type="text" id="TMSI" name="TMSI" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>channel：</td>
   			<td><input type="text" id="channel" name="channel" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>TCH：</td>
   			<td><input type="text" id="TCH" name="TCH" class="easyui-validatebox" required="true"/></td>
   		</tr>
   		<tr>
   			<td>IMEI：</td>
   			<td><input type="text" id="IMEI" name="IMEI" class="easyui-validatebox" required="true"/></td>
   			<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
   			<td>l2：</td>
   			<td>
   			<input type="text" id="l2" name="l2" class="easyui-validatebox" required="true"/>
   			<input type="hidden" id="flag" name="flag"/>
   			</td>
   		</tr>
   	</table>
   </form>
 </div>

 <div id="dlg-buttons">
 	<a href="javascript:checkData()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
 	<a href="javascript:closeDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
 </div>

 <div id="dlg2" class="easyui-dialog" style="width:400px;height:180px;padding:10px 20px"
            closed="true" buttons="#dlg-buttons2">
        <form id="uploadForm" action="${pageContext.request.contextPath}/sdcch/upload.do" method="post" enctype="multipart/form-data">
        	<table>
        		<tr>
        			<td>下载模版：</td>
        			<td><a href="javascript:void(0)" class="easyui-linkbutton"  onclick="downloadTemplate()">导入模版</a></td>
        		</tr>
        		<tr>
        			<td>上传文件：</td>
        			<td><input type="file" name="sdcchUploadFile"></td>
        		</tr>
        	</table>
        </form>
	</div>

	<div id="dlg-buttons2">
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="uploadFile()">上传</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg2').dialog('close')">关闭</a>
	</div>

	
</body>
</html>